<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		
		*{
			margin:0px;
			padding: 0px;
		}
		body{
			background: #F1F1F1 url() 0 0 no-repeat;
		}

		ul{
			width: 820px;
			height: 184px;
			margin: 100px auto;
		}

		li{
			list-style: none;
			float: left;
		}
	</style>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script>
		$(function () {

			function changeNum(num) {
				if(num<10){
					return "0"+num;
				}else{
					return ""+num;
				}
			}

			function run() {
				now = new Date();

				h = changeNum(now.getHours());
				m = changeNum(now.getMinutes());
				s = changeNum(now.getSeconds());

				str = h+m+s;

				// 循环字符，加每个图片充分一点的图片地址
				for (var i = 0; i <str.length; i++) {
					$('.time').eq(i).attr('src',"./"+str[i]+".png");
				}

				// console.log($('.time'));

			}

			run();

			setInterval(run,1000);
			
		})
	</script>
</head>
<body>
	<ul>
		<li><img class="time" src="./8.png" alt=""></li>
		<li><img class="time" src="./8.png" alt=""></li>
		<li><img src="./dian.png" alt=""></li>
		<li><img class="time" src="./8.png" alt=""></li>
		<li><img class="time" src="./8.png" alt=""></li>
		<li><img src="./dian.png" alt=""></li>
		<li><img class="time" src="./8.png" alt=""></li>
		<li><img class="time" src="./8.png" alt=""></li>
	</ul>
</body>
</html>